package org.dormi.learn.primitive;

import org.dormi.learn.utils.Assert;

import java.util.Objects;

/**
 * 行业
 *
 * @author : dormi330
 * @version : 1.0
 */
public class Industry extends _Primitive_ {

    private final String code;
    private final String name;
    private final String remark;

    public Industry(String code, String name, String remark) {
        Assert.isNotNull(code, "不能为null: Industry.code");
        Assert.isNotNull(code, "不能为null: Industry.name");

        this.code = code;
        this.name = name;
        this.remark = remark;
    }

    /* === hash/equals === */
    /* === hash/equals === */
    /* === hash/equals === */

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Industry)) return false;
        Industry that = (Industry) o;
        return Objects.equals(getCode(), that.getCode());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getCode());
    }

    /* === set/get === */
    /* === set/get === */
    /* === set/get === */

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getRemark() {
        return remark;
    }
}